package com.software.car.common.enums;

/**
 * 枚举模板类型
 *
 * @Author 魔法はまだ解けない
 * @Date 2021/2/24
 */
public enum ModelTypeEnum {

    SINGLE_COLUMN(1, "单次填写"),
    MULTI_COLUMN(2, "多次填写");


    /**
     * id
     */
    private int id;
    /**
     * 描述
     */
    private String description;

    /**
     * 异常码枚举构造器
     *
     * @param description 异常状态信息
     */
    ModelTypeEnum(int id, String description) {
        this.id = id;
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 获取描述
     * @param id
     * @return
     */
    public static String getDescription(Integer id) {
        ModelTypeEnum[] values = ModelTypeEnum.values();
        for (ModelTypeEnum modelTypeEnum : values) {
            if(modelTypeEnum.getId()==id){
                return modelTypeEnum.getDescription();
            }
        }
        return null;
    }
}
